package org.groupg.filetodb.model;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;

import java.util.List;

/**
 * 处理数据用的事件对象
 */
public class RecordData {
    private String sql;
    private List<String[]> batch;

    public RecordData() {
    }

    @Override
    public String toString() {
        return MoreObjects.toStringHelper(this)
                .add("sql", sql)
                .add("batch", batch)
                .toString();
    }

    @Override
    public boolean equals(Object o) {
        if (o == null || getClass() != o.getClass()) return false;
        RecordData recordData = (RecordData) o;
        return Objects.equal(getSql(), recordData.getSql()) && Objects.equal(getBatch(), recordData.getBatch());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getSql(), getBatch());
    }

    public String getSql() {
        return sql;
    }

    public void setSql(String sql) {
        this.sql = sql;
    }

    public List<String[]> getBatch() {
        return batch;
    }

    public void setBatch(List<String[]> batch) {
        this.batch = batch;
    }
}
